package com.kefu.chat.vo;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.kefu.chat.model.ChatFaq;
import com.kefu.common.context.KefuContext;
import com.kefu.common.util.JacksonUtil;
import com.kefu.common.vo.AbstractInsertVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

@Data
@ApiModel("添加常见问题方案")
public class ChatFaqInsertVo extends AbstractInsertVo<ChatFaq> {
    /**
     * 方案名称
     */
    @ApiModelProperty(name = "faqName", value = "方案名称")
    private String faqName;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer sortNo;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    private Integer faqStatus;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    private String faqRemark;

    @ApiModelProperty(value = "超过个数分页")
    private Integer guidePageCount;

    @ApiModelProperty(value = "引导语")
    private String guideWord;

    @ApiModelProperty(value = "触发器，备用")
    private String triggerId;

    @ApiModelProperty(value = "渠道id")
    private String channelId;

    @ApiModelProperty(value = "展示形式1=问题列表，2=多分组问题，3=多业务")
    private Integer showType;

    @ApiModelProperty(value = "展示内容")
    private String showName;

    @ApiModelProperty(value = "问题列表/多业务/多分组")
    private String showContent;

    @Override
    public ChatFaq convert() {
        KefuContext context = KefuContext.getKefuContext();
        ChatFaq info = BeanUtil.toBean(this, ChatFaq.class);
        info.setUpdateTime(context.getNow());
        info.setCreateTime(context.getNow());
        info.setCreateUser(context.getUserId());
        info.setUpdateUser(context.getUserId());
        info.setCreateName(context.getUserName());
        info.setUpdateName(context.getUserName());
        info.setTenantId(context.getTenantId());
        return info;
    }
}
